package jvm.memory;

import java.util.ArrayList;

//Dump文件
//-Xms256M -Xmx128M -XX:+HeapDumpOnOutOfMemoryError
public class JProfiler {

    public byte[] array = new byte[1024 * 1024];

    public static void main(String[] args) {
        ArrayList<JProfiler> list = new ArrayList<>();
        int count = 0;
        try {
            while (true) {
                list.add(new JProfiler());
                count++;
            }
        } catch (Error e) {
            System.out.println("运行次数："+count);
            e.printStackTrace();
        }

        //Throwable异常父类
        //Error
        //Exception
    }
}
